doctype html
html
  head
    include layout/meta
    title 空港出行后台管理系统
    script.
      sessionStorage.clear();
  body
    script(src="vendor/jQuery-3.2.1/jquery.js")
    script(src="vendor/layer-3.0.3/layer.js")
    //- Promise 垫片
    script.
      if (!window.Promise) {
        document.write('<script src="vendor/promise-polyfill-6.0.2/promise.js"><\/script>');
      }
    script(src="vendor/cross-storage-1.0.0/client.min.js")
    script(src="config.js")
    script(src="js/app.js")

    script.
      (function (window, $, undefined) {

        if (util.checkToken()) {
          util.get(ajaxURL.SYSTEM + (oUser.account === 'admin' ? '/sys/v1/menu/queryAll' : '/sys/v1/menu/queryMenuByRole?userId=' + oUser.userId), function (res) {
            if (res.data && res.data.length > 0) {
              localStorage.menu = JSON.stringify(res.data);
              window.location.href = '/html/index/index.html';
            } else {
              util.tip.warn('当前用户无可用菜单，请重新登录', 2000, function () {
                // 清理所有缓存数据
                sessionStorage.clear();
                localStorage.clear();
                window.location.href = '/login.html';
              });
            }
          });
        }

      })(window, jQuery);
